const API = require('../../pages/api/index')
const { typeJson } = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist'))


Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown:"",
    pullup:2,
    addButton:true,
    Refresh:false,
    prolist:wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist')),
    listConfig: [
        {
          label: '入井时间',
          prop: 'inWellTime'
        },
        {
          label: '总结记录',
          prop: 'remarks',
          
        }
      ],

      slide: {
        slideButton: {
          text: '编辑',
          extClass: 'test',
            src: '/page/weui/cell/icon_star.svg', // icon的路径
        },
        formConfig: [
          {
            label: '带班日期',
            prop: 'meetingId',
            type: 'dropDownSearch',
            hidden: 'look',
            required:true,
            net: {
              url: '/app/siteMeeting/list',
              method: 'post',
              key: 'meetingDate',
              data:{
                mineId: true,  
              },
              value: 'id'
            }
          },
          {
            label: '带班日期',
            prop: 'meetingDate',
            //type:'dataTime',
            hidden:"edit"
          },
         {
          label: '入井时间',
          prop: 'inWellTime',
          type:"dateTime",
          required:true,
         },
          {
          label: '班组长',
          prop: 'teamLeaderId',
          tag: 'userid',
          hidden:"all"
          },
          {
            label: "是否参加班前会",
            prop: "isMeeting",
            jsonType: typeJson.isMeeting,
            type: 'dropDown',
            required:true,
          },
          {
            label: "工作任务选项",
            prop: "workNote",
            jsonType: typeJson.workNote,
            type: 'dropDown',
            required:true,
          },
          {
            label: "劳保工具是否齐全",
            prop: "isTool",
            jsonType: typeJson.isTool,
            type: 'dropDown',
            required:true,
          },
         
         {
          label: '出井时间',
          prop: 'outWellTime',
          type:"dateTime",
          required:true,
         },
  
          {
            label: "总结记录",
            prop: "remarks",
            type:"textarea",
          },
      
          {
            label: '上传照片',
            prop: 'files',
            type: 'image',
            
          },
  
  
       
         
        
          ],
      },

      formConfig: [
        {
          label: '带班日期',
          prop: 'meetingId',
          type: 'dropDownSearch',
          hidden: 'look',
          required:true,
          net: {
            url: '/app/siteMeeting/list',
            method: 'post',
            key: 'meetingDate',
            data:{
              mineId: true,  
            },
            value: 'id'
          }
        },
        {
          label: '带班日期',
          prop: 'meetingDate',
          type:'dataTime',
          hidden:"edit"
        },
        {
          label: '参会部门及人员',
          prop: 'inoutMinerIds',
          hidden:"look",
          type:"tree",
          required:true,
             net: {
            url: '/app/siteMeeting/getUserTree',
            method: 'post',
            data:{
                    mineId: true,
              },
          },
          prat:'attendDepart'
        },
        {
          label: "参会部门及人员",
          prop: "options",
          hidden:"edit",
          disdata:"line"
        },
       {
        label: '入井时间',
        prop: 'inWellTime',
        type:"dateTime",
        required:true,
       },
        {
        label: '班组长',
        prop: 'teamLeaderId',
        tag: 'userid',
        hidden:"all"
        },
       
        {
          label: "是否参加班前会",
          prop: "isMeeting",
          jsonType: typeJson.isMeeting,
          type: 'dropDown',
          required:true,
        },
        {
          label: "工作任务选项",
          prop: "workNote",
          jsonType: typeJson.workNote,
          type: 'dropDown',
          required:true,
        },
        {
          label: "劳保工具是否齐全",
          prop: "isTool",
          jsonType: typeJson.isTool,
          type: 'dropDown',
          required:true,
        },
       
       {
        label: '出井时间',
        prop: 'outWellTime',
        type:"dateTime",
        required:true,
       },

        {
          label: "总结记录",
          prop: "remarks",
          type:"textarea",
        },
    
        {
          label: '上传照片',
          prop: 'files',
          type: 'image',
          
        },


     
       
      
        ],
    
        
        net: {
       
            select: {
              url: `/app/siteInandoutwell/getList`,
              method: 'post',
              data: {
                mineId: true,
                
              }
            },
            delete: {
              url: '/app/siteInandoutwell/delete',
              method: 'post',
              data: {
                
              }
            },
            insert: {
              url: '/app/siteInandoutwell/edit',
              method: 'post',
              data: {
                mineId:true,
                createUser:"userid"
               
              }
            },
            update: {
              url: '/app/siteInandoutwell/edit',
              method: 'post',
              data: {
  
              }
            }
  
          
        },
        showCom:true
      },

     
  

  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    console.log('5555');
    this.setData({
      showCom: false
    });
    this.setData({
      showCom: true
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

    /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.showLoading({
      title: '刷新中...',
    })
    this.setData({
      Refresh:true
    })
    wx.hideLoading();
    wx.stopPullDownRefresh()
    this.setData({
      Refresh:false
    })
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})